package com.nanyang.tms.api.dto.request.saleproduct.add;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>Description:(销售产品计费重进位规则表)</p>
 *
 * @author lv
 * @date 2022年11月12日 下午05:06:46
 * @Copyright Copyright (c) 2020 www.nanyang.cn Inc. All rights reserved.
 */
@Data
public class SaleProductCarryRuleAddRequest implements Serializable {
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;


    /**
     * 国家编码
     */
    @Length(max = 3, message = "countyCode长度需小于3个字符")
    private String countyCode;

    /**
     * 国家名称
     */
    @Length(max = 30, message = "countyCode长度需小于30个字符")
    private String countyName;

    /**
     * 起始重量
     */
    @NotNull(message = "起始重量不能为空")
    @Digits(integer = 9, fraction=3, message = "weightStart格式不正确")
    @DecimalMin(value = "0.00", message = "weightStart格式不正确")
    private BigDecimal weightStart;

    /**
     * 截至重量
     */
    @NotNull(message = "截至重量不能为空")
    @Digits(integer = 9, fraction=3, message = "weightEnd格式不正确")
    @DecimalMin(value = "0.00", message = "weightEnd格式不正确")
    private BigDecimal weightEnd;

    /**
     * 进位类型编码
     */
    @NotEmpty(message = "进位类型编码不能为空")
    @Length(max = 20, message = "carryTypeCode长度需小于20个字符")
    private String carryTypeCode;

    /**
     * 进位类型名称
     */
    @NotEmpty(message = "进位类型编码不能为空")
    @Length(max = 30, message = "carryTypeName长度需小于30个字符")
    private String carryTypeName;

    /**
     * 规则值
     */
    @NotNull(message = "规则值不能为空")
    @Digits(integer = 9, fraction=3, message = "carryValue格式不正确")
    @DecimalMin(value = "0.00", message = "carryValue格式不正确")
    private BigDecimal carryValue;
}